import request from '@/utils/request'

export function getMaterialList(params) {
  return request({
    url: '/material',
    method: 'get',
    params
  })
}

export function getMaterialInfo(id) {
  return request({
    url: '/material',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function delMaterial(id) {
  return request({
    url: '/material',
    method: 'delete',
    params: {
      id: id
    }
  })
}

export function modifyMaterial(id, payload) {
  return request({
    url: '/material',
    method: 'put',
    params: {
      id: id
    },
    data: {
      introduction: payload.introduction,
      remark: payload.remark
    }
  })
}

export function addMaterial(data) {
  return request({
    url: '/material',
    method: 'post',
    data
  })
}
